import json

import numpy as np

from modules.tools import seconds_to_hms
from get_accuracy import merge_matches

if __name__ == "__main__":
    with open('data/正气宝 2354 仁心说医事.json', 'r', encoding='utf-8') as f:
        matches = json.loads(f.read())

    matches = np.array(matches)
    matches = merge_matches(matches)
    for match in matches:
        print([seconds_to_hms(m) for m in match],
              match[2] - match[0],
              match[3] - match[1])
